<template>
	<my-template>
		<view slot="header">
			<image src="../../static/png2.jpg"
			class="image2"
			width="100%"></image>
		</view>
		<view slot="content" class="view1">
			<h1 class="h11">{{note.title}}</h1>
			<view class="view2" @click="handleClick1(authorInfo.id)">
					<image class="image1" :src="'/app/image/'+authorInfo.id+'/header/'+authorInfo.head"></image>
				<text class="text1">
					{{authorInfo.name}}
				</text>
				
			</view>
	
			
			</h2>
			<my-html :textInfo="note.text"></my-html>
		</view>
	</my-template>
</template>
<script>
	import myHtml from '../../components/my-html.vue'
	import myTemplate from '../../components/my-template.vue'
	export default{
		components:{
			myTemplate,myHtml
		},
		data(){
			return{
				note:{},
				authorInfo:{}
			}
		},
		methods:{
			handleClick1(userId){
				uni.navigateTo({
					url:'../info/info_id?id='+userId
				})
			}
		},
		onLoad(option) {
			        // this.$axios.post('/app/api/v4/getOneNote',{
           //      id:this.$route.params.id
           //  }).then(res=>{
           //      this.note=res.data
           //  })
		   uni.request({
		   	url:'/app/api/v4/getOneNote',
			method:'POST',
			data:{
				id:option.id
			},
			success:res=>{
				this.note=res.data
				uni.request({
					url:'/app/api/v2/getInfo2',
					method:"POST",
					data:{
						id:this.note.createBy
					},
					success:res=> {
						this.authorInfo=res.data
					}
				})
			}
		   })
		   
		}
	}
</script>

<style scoped>
	.h11{
		color: #007AFF;
		font-weight: 300;
		margin-left: 10px;
	}
	.view2{
		float: right;
		margin-right: 1%;
	}
	.text1{
		position: relative;
		top: -12px;
		vertical-align: middle;
	}
	.image1{
	border-radius: 100%;
	width: 40px;
	height: 40px;
}
	.image1:hover{
		cursor: pointer;
	}
	.view1{
		min-height: 300px;	
	}
	.image2{
		border-radius: 10%;
	}
</style>
